<meta charset="utf-8">

<div class="box box-primary" id="pmpTasks_difficulty">
		<div class="box-body">
		<form action="" id="pmpTasks_difficulty_form">
					<div class="form-group">
							<label for="title">难度系数</label>
							 <select id="difficultyScoreId" name="difficultyScoreId" v-model="difficultyScoreId" class=" form-control"
								v-kselect="{url:'/pmp/service/pub/pmpALine/loadDifScoreComboboVo',vmodel:'difficultyScoreId',firstEmpty:'true'}">
							</select>
						</div>
					</form>
		</div>
		
		<div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancel">取消</button>
			<button type="button" class="btn btn-info pull-right" v-on:click="doAsign">提交</button>
		</div>
		
</div>
<script type="text/javascript">
	new Vue({
			el : '#pmpTasks_difficulty',
			data : {
				 projectId: project_detail_main.$data.projectId,
				 taskId: zfesLayerEditDg.getLayerParam().id,
				 difficultyScoreId: zfesLayerEditDg.getLayerParam().difficultyScoreId,
				bus : new Vue()
			},
			mounted : function() {
				var _this = this;
				setTimeout(function(){_this.difficultyScoreId=zfesLayerEditDg.getLayerParam().difficultyScoreId}, 500);
			},
			methods : {
				doAsign : function() {
					if ($("#pmpTasks_difficulty_form").valid()) {
						var _this = this;
				        var url = "/pmp/service/pm/pmpTasks/updateDifficultyScore";
				       zfesAjax.ajaxTodo(url, {"id":_this.taskId,"difficultyScoreId": _this.difficultyScoreId}, function(data) {
				    	   alertSwal.successText(data.message);
							layer.close(layer.index);
				       });
					}
				},
				cancel : function() {
					layer.close(layer.index);
				}
			}
		});
</script>
